
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

package com.hlkj.pay.common;

import com.hlkj.framework.common.exception.IErrorCode;
import com.hlkj.pay.common.constants.ResultCodeConstant;

/**
 * @author lyc
 */

public enum OpenApiResultCode implements IErrorCode {
    PROCESS_ERROR( ResultCodeConstant.OPENAPI_PREFIX+0, "业务处理失败"),
    MERCHANT_APP_NOT_EXIST( ResultCodeConstant.OPENAPI_PREFIX+1, "商户app不存在"),
    MERCHANT_APP_NOT_EFFECT( ResultCodeConstant.OPENAPI_PREFIX+2, "商户app无效"),

    MERCHANT_NOT_EXIST( ResultCodeConstant.OPENAPI_PREFIX+3, "商户不存在"),
    MERCHANT_NOT_EFFECT( ResultCodeConstant.OPENAPI_PREFIX+4, "商户无效"),
    MERCHANT_APP_CHANNEL_NOT_EXIST( ResultCodeConstant.OPENAPI_PREFIX+5, "商户通道不存在"),
    MERCHANT_APP_CHANNEL_NOT_EFFECT( ResultCodeConstant.OPENAPI_PREFIX+6, "商户通道无效"),
    MERCHANT_PAY_LIMIT_DAY_AMOUNT( ResultCodeConstant.OPENAPI_PREFIX+99, "商户日交易金额超出限额"),
    MERCHANT_PAY_LIMIT_MONTH_AMOUNT( ResultCodeConstant.OPENAPI_PREFIX+100, "商户月交易金额超出限额"),
    MERCHANT_PAY_LIMIT_AMOUNT( ResultCodeConstant.OPENAPI_PREFIX+101, "商户单笔交易金额超出限额"),

    MERCHANT_PUBLIC_KEY_NOT_EFFECT( ResultCodeConstant.OPENAPI_PREFIX+5, "商户公钥无效"),
    MERCHANT_SIGN_ERROR( ResultCodeConstant.OPENAPI_PREFIX+6, "签名错误"),
    MERCHANT_SIGN_TYPE_ERROR( ResultCodeConstant.OPENAPI_PREFIX+7, "签名方式错误"),
    MERCHANT_DATETIME_ERROR( ResultCodeConstant.MERCHANT_PREFIX+8, "时间戳已过期"),
    MERCHANT_DATA_ERROR( ResultCodeConstant.MERCHANT_PREFIX+9, "代付入账方式不匹配"),
    DATA_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+10, "数据不存在"),
    DATA_HAS_EXIST(ResultCodeConstant.COMMON_PREFIX+11, "数据已存在"),
    CHANNEL_EXTENSION_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+12, "当前通道功能不能操作"),
    CHANNEL_OPERATION_NOT_EXIST(ResultCodeConstant.COMMON_PREFIX+13, "操作失败"),
    CHANNEL_IP_NOT_EFFECT(ResultCodeConstant.COMMON_PREFIX+14, "ip不在白名单中"),


    MERCHANT_COMM_RATE_BASE_EXIST( ResultCodeConstant.OPENAPI_PREFIX+102, "商户外扣手续费率不存在"),
    MERCHANT_CHANNEL_BALANCE_NOT_ENOUGH( ResultCodeConstant.OPENAPI_PREFIX+103, "商户手续费账号余额不足"),
    PAY_WAY_NOT_EXITS( ResultCodeConstant.PAY_PREFIX+104, "支付方式不存在"),
    PAY_WAY_NOT_EFFECT( ResultCodeConstant.PAY_PREFIX+105, "支付方式无效"),
    MERCHANT_TRADE_CLOSED( ResultCodeConstant.PAY_PREFIX+106, "商户交易已关闭"),


    MERCHANT_PAY_ORDER_FORMAT_EXIST( ResultCodeConstant.OPENAPI_PREFIX+201, "商户订单号格式错误"),
    MERCHANT_PAY_ORDER_EXIST( ResultCodeConstant.OPENAPI_PREFIX+202, "商户订单号已存在"),
    MERCHANT_PAY_ORDER_NOT_EXIST( ResultCodeConstant.OPENAPI_PREFIX+203, "商户订单不存在"),
    MERCHANT_PAY_ORDER_HAS_CLOSE( ResultCodeConstant.OPENAPI_PREFIX+204, "订单已关闭"),
    MERCHANT_PAY_ORDER_HAS_CANCEL( ResultCodeConstant.OPENAPI_PREFIX+205, "订单已取消支付"),
    MERCHANT_PAY_ORDER_HAS_SUCCESS( ResultCodeConstant.OPENAPI_PREFIX+206, "订单已支付成功"),
    MERCHANT_PAY_ORDER_OPERATE_FAIL( ResultCodeConstant.OPENAPI_PREFIX+207, "订单操作失败"),
    MERCHANT_PAY_ORDER_TERM_FAIL( ResultCodeConstant.OPENAPI_PREFIX+208, "订单操作失败"),
    MERCHANT_PAY_ORDER_FUND_TYPE_ERROR( ResultCodeConstant.OPENAPI_PREFIX+209, "当前分账类型不支持"),
    MERCHANT_PAY_ORDER_FUND_DATA_ERROR( ResultCodeConstant.OPENAPI_PREFIX+210, "分账数据错误,请检查"),
    MERCHANT_PAY_ORDER_FUND_ERROR( ResultCodeConstant.OPENAPI_PREFIX+211, "分账失败"),
    MERCHANT_PAY_ORDER_SUBSIDY_ERROR( ResultCodeConstant.OPENAPI_PREFIX+212, "营销补贴失败"),


    MERCHANT_REFUNDING_ERROR( ResultCodeConstant.OPENAPI_PREFIX+301, "当前已存在退款中的订单,请退款完成后发起"),
    MERCHANT_REFUND_ORDER_NOT_EXIST( ResultCodeConstant.OPENAPI_PREFIX+302, "退款订单不存在"),
    MERCHANT_REFUND_AMOUNT_ERROR( ResultCodeConstant.OPENAPI_PREFIX+303, "订单退款金额大于可退款金额"),
    MERCHANT_REFUND_NOT_SUPPORT( ResultCodeConstant.OPENAPI_PREFIX+304, "当前支付方式不支持退款"),


    MERCHANT_TERM_NOT_ERROR( ResultCodeConstant.OPENAPI_PREFIX+401, "终端新增失败,"),
    MERCHANT_TERM_NOT_SUPPORT( ResultCodeConstant.OPENAPI_PREFIX+402, "当前通道不可以新增终端"),
    MERCHANT_CHANNEL_SPLIT_ERROR( ResultCodeConstant.OPENAPI_PREFIX+401, "易生子商户拆分失败,"),
    MERCHANT_ACCESS_EXIST( ResultCodeConstant.OPENAPI_PREFIX+403, "当前进件已存在"),


    MERCHANT_PAY_ORDER_HAS_FAIL( ResultCodeConstant.MERCHANT_PREFIX+405, "订单支付失败"),
    MERCHANT_PAY_WAY_NOT_EFFECT( ResultCodeConstant.MERCHANT_PREFIX+406, "当前支付方式不支持"),
    MERCHANT_ACCT_ORDER_NOT_EFFECT( ResultCodeConstant.MERCHANT_PREFIX+501, "当前订单不可分账"),
    MERCHANT_ACCT_ORDER_ERROR( ResultCodeConstant.MERCHANT_PREFIX+502, "订单分账退回数据错误,账号%s不存在支付分账数据"),

    MERCHANT_ACCT_TYPE_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+503, "订单分账类型不存在"),
    MERCHANT_SUBSIDY_CS_NOT_COMPLETED( ResultCodeConstant.MERCHANT_PREFIX+504, "订单清算未完成"),
    MERCHANT_SUBSIDY_ORDER_NOT_EFFECT( ResultCodeConstant.MERCHANT_PREFIX+505, "当前订单不可申请营销补贴"),
    MERCHANT_SUBSIDY_ORDER_ERROR( ResultCodeConstant.MERCHANT_PREFIX+506, "订单营销补贴退回数据错误,营销类型%s不存在"),
    MERCHANT_SUBSIDY_BACK_AMOUNT_ERROR( ResultCodeConstant.MERCHANT_PREFIX+507, "当前营销补贴退回金额不得大于申请金额"),

    ;

    /**
     * 错误码
     */
    private final Integer code;
    /**
     * 错误提示
     */
    private final String msg;

    OpenApiResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

}
